<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./lib/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
    <input type="button" value="为了部落" @click="lang()">
    <input type="button" value="出击" @click="stop()">
    <h3>{{message}}</h3>
    </div>

    <script>
        let vm = new Vue({
            el: '#app',
            data: {
            message:'个搭嘎发过火',
            intervalid:null
        },
            methods: {
             lang(){
                if(this.intervalid!=null) return

                this.intervalid= setInterval(()=>{
                 var start=this.message.substr(0,1);
                 console.log(start)
                 var end=this.message.substr(1);
                 var res=end+start;
                 this.message=res;
             },400)
            },

             stop(){
                  clearInterval(this.intervalid),
                  this.intervalid=null
             }
                 
            }
        });
    </script>
</body>

</html>